<?php
require_once( 'Zend/Db.php' );
require_once( 'Zend/Db/Table.php' );
require_once( 'Zend/Db/Table/Abstract.php' );

class ES_MEDICO extends Zend_Db_Table_Abstract
{
	protected $_name = 'ES_MEDICO';
	
	public function listallMedicosB(){
        	
            $result = $this->fetchAll(null ,null,10,0);
            return $result;
        }
    public function listallMedicos(){
    	    
    	$select = $this->select();
        $select = $this->select()->setIntegrityCheck(false);
        $parray = array('PENOMBRE'=>'PENOMBRE', 'APELLIDO'=>'APELLIDO', 'PEDNI'=>'PEDNI');
        $select->from($this->_name)
        		->join('PERSONAL', 'PERSONAL.PEDNI = ES_MEDICO.PEDNI',$parray);
        		
        $result = $this->fetchAll($select);
        return $result;
        		
    }
}

?>